// estimations and invoices
@import 'layout_variables';
@import './variables';

body.caerp[class*="estimations/{id}"],
body.caerp[class*="invoices/{id}"] {
	.main_actions {
		div[role="group"] {
			order: 0;
		}

		.child-container {
			>div {
				display: flex;

				>div {
					margin: 0 0 var(--padding-s) var(--padding-s);
				}
			}
		}
	}

	.layout.flex {
		div[class*="col-md"] {
			>div:not(:last-child) {
				padding-bottom: var(--padding-xl);
			}
		}
	}

	.quotation_item_title {
		justify-content: space-between;
		padding: 0 2px var(--padding-s);
		width: 100%;

		h3 em {
			font-weight: normal;
		}

		>div:last-child:not(:first-child) {
			white-space: nowrap;
		}
	}

	.separate_block {
		.form-group {
			padding-bottom: var(--padding-s);
		}
	}

	.content {
		>button {
			margin: var(--padding-s);
		}
	}

	.ht-before-discounts,
	.ht-after-discounts,
	.total-ttc,
	.total-due {
		table {
			margin-bottom: var(--padding-l);
		}

		table tr.row_recap th,
		table tr.row_recap td:not(.level_spacer):not(.empty) {
			background: none;
			font-size: 1.1rem;
		}
	}
}

@media (min-width: $wideWidth ) {

	body.caerp[class*="estimations/{id}"],
	body.caerp[class*="invoices/{id}"] {
		.main_actions {
			div.totals {
				order: 1;
			}

			div.child-container {
				order: 2;
			}
		}
	}
}

@media (max-width: $wideWidth ) {

	body.caerp[class*="estimations/{id}"],
	body.caerp[class*="invoices/{id}"] {
		.main_actions {
			flex-wrap: wrap;

			div.totals {
				order: 2;
				width: 100%;
			}

			div.child-container {
				order: 1;
			}
		}
	}
}
